package org.langqiao.classloader;

public class MyClassLoaderTest {
	public static void main(String[] args) throws ClassNotFoundException {
		MyClassloader loader1 = new MyClassloader("G:/langqiao_git/JavaSE");
		MyClassloader loader2 = new MyClassloader("G:/langqiao_git/JavaSE");
		Class<?> c1 = loader1.findClass("org.langqiao.classloader.HelloWorld");
		Class<?> c2 = loader1.findClass("org.langqiao.classloader.HelloWorld");
		Class<?> c3 = loader2.findClass("org.langqiao.classloader.HelloWorld");
		Class<?> c4 = loader2.findClass("org.langqiao.classloader.Demo01");
		Class<?> c5 = loader2.findClass("java.lang.String");
		System.out.println(c1.getClassLoader() + "****" + c1.hashCode());
		System.out.println(c2.getClassLoader() + "****" + c2.hashCode());
		System.out.println(c3.getClassLoader() + "****" + c3.hashCode());
		System.out.println(c4.getClassLoader() + "****" + c4.hashCode());
		System.out.println(c5.getClassLoader() + "****" + c5.hashCode());
	}
}
